package com.bfxy.rabbit.api;

import com.bfxy.rabbit.api.exception.MessageRuntimeException;

import java.util.List;

/**
 * @describte:封装生产者
 * @program:rabbit-parent
 * @author:zhengdp
 * @create:2021-09-14 21:14:54
 **/
public interface MessageProducer {

    /**
     * 消息的发送
     * @param message
     * @throws MessageRuntimeException
     */
    void send(Message message) throws MessageRuntimeException;

    /**
     * 消息的发送 附带callback回调执行相应的业务逻辑处理
     * @param message
     * @param sendCallback  回调方法
     * @throws MessageRuntimeException
     */
    void send(Message message,SendCallback sendCallback) throws MessageRuntimeException;

    /**
     * 消息的批量发送
     * @param messages
     * @throws MessageRuntimeException
     */
    void send(List<Message> messages) throws MessageRuntimeException;


}
